/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fyx.core.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author xljan
 */
@Entity
@Table(name = "fyx_atribute")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FyxAtribute.findAll", 
        query = "SELECT f FROM FyxAtribute f"),
    @NamedQuery(name = "FyxAtribute.findByKey", 
        query = "SELECT f FROM FyxAtribute f WHERE f.key = :key")})
public class FyxAtribute implements Serializable {
    public static final String DECIMAL_SEPARATOR = "Decimal separator";
    public static final String CURRENCY = "Currency";
    public static final String DATE_PATTERN = "Date format";
    public static final String ISO_LANGUAGE = "ISO language";
    
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "key_")
    private String key;
    @Lob
    @Size(max = 65535)
    @Column(name = "value_")
    private String value;

    public FyxAtribute() {
    }

    public FyxAtribute(String key) {
        this.key = key;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (key != null ? key.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FyxAtribute)) {
            return false;
        }
        FyxAtribute other = (FyxAtribute) object;
        if ((this.key == null && other.key != null) || (this.key != null && !this.key.equals(other.key))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.fyx.core.entity.FyxAtribute[ key=" + key + " ]";
    }
    
}
